#include<main.h>

void Run(STUDENT stu[], GRADE grd[])
{
	int s, c, i = 0;
	printf("请输入班级人数:");
	scanf_s("%d", &s);
	printf("请输入课程数:");
	scanf_s("%d", &c);
	while (i >= 0 && i <= 9)
	{
		printf("输入命令:\n0.Input\n1.Input_Excel\n2.Calculate\n3.Sort_General_up\n4.Sort_General_down\n5.Sort_ID_down\n6.Sort_Name\n7.Search\n8.Statistical\n9.print\n10.Print_Excel\nother Number.exit\n");
		scanf_s("%d", &i);
		switch (i)
		{
		case 0:
			Input(stu, grd, s, c);
			break;
		case 1:
			Input_Excel(stu, grd, s, c);
			break;
		case 2:
			Calculate(stu, grd, s, c);
			break;
		case 3:
			qsort(stu, s, sizeof(stu[0]), Sort_General_up);
			break;
		case 4:
			qsort(stu, s, sizeof(stu[0]), Sort_General_down);
			break;
		case 5:
			qsort(stu, s, sizeof(stu[0]), Sort_ID_down);
			break;
		case 6:
			qsort(stu, s, sizeof(stu[0]), Sort_Name);
			break;
		case 7:
			Search(stu, s, c);
			break;
		case 8:
			Statistical(stu, grd, s, c);
			break;
		case 9:
			Print(stu, grd, s, c);
			break;
		case 10:
			Print_Excel(stu, grd, s, c);
		}

		system("pause");
		system("cls");
	}
}